//
//  Car.m
//  OCChater2
//
//  Created by 郭家正 on 2019/1/7.
//  Copyright © 2019 TM. All rights reserved.
//

#import "Car.h"

@implementation Car
//@synthesize name;
//@synthesize color;
//@synthesize isNewEnergy;
//
//@synthesize name = _name;
//@synthesize color = _color;
//@synthesize isNewEnergy = _isNewEnergy;
//
//-(void)setName:(NSString *)name {
//    _name = name;
//}
//
//-(NSString *)name {
//    return _name;
//}



-(void)driveCar {
    if (self.isNewEnergy) {
        NSLog(@"我开%@车,这个车是%@颜色，新能源汽车",_name,_color);
    }
    else {
        NSLog(@"我开%@车,这个车是%@颜色，汽油汽车",_name,_color);
    }
    
}
-(void)backCar {
    if (self.isNewEnergy) {
        NSLog(@"我倒%@车,这个车是%@颜色，新能源汽车",self.name,self.color);
    }
    else {
        NSLog(@"我倒%@车,这个车是%@颜色，汽油汽车",self.name,self.color);
    }
}
-(void)stopCar {
    if (self.isNewEnergy) {
        NSLog(@"我停%@车,这个车是%@颜色，新能源汽车",self.name,self.color);
    }
    else {
        NSLog(@"我停%@车,这个车是%@颜色，汽油汽车",self.name,self.color);
    }
}

@end
